home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / gawk-3.000 / gawk-3 / gawk-3.0.0 / awklib / eg / misc / findpat.sh < prev   
Encoding:
Text File  |  1996-01-11  |  224 b   |  11 lines

  1. awk '{
  2.        if ($1 == "FIND")
  3.          regex = $2
  4.        else {
  5.          where = match($0, regex)
  6.          if (where != 0)
  7.            print "Match of", regex, "found at", \
  8.                      where, "in", $0
  9.        }
  10. }'
  11.